package xuesm.singleton.lazy;

/**
 * @Author: xuesm
 * @Description: 静态内部类单例
 * @Date: Create in 12:56 2019/3/28
 */
public class LazyInnerClassSingleton {

	private LazyInnerClassSingleton(){
		if (LazyHolder.LAZY != null){
			throw new RuntimeException("反射入侵");
		}
	};

	public static final LazyInnerClassSingleton getInstance(){
		return LazyHolder.LAZY;
	}

	private static class LazyHolder{
		private static final LazyInnerClassSingleton LAZY = new LazyInnerClassSingleton();
	}
}
